function fn(arr) {
  const set = new Set(arr);
  return Array.from(set);
}

function fn1(arr) {
  const set = new Set(arr);
  return [...set];
}

function fn2(arr) {
  let res = [];
  arr.forEach((item) => {
    if (res.indexOf(item) == -1) {
      res.push(item);
    }
  });
  return res;
}

console.log(fn2([1, 1, 2, 3, 4, 4, 5, 5, 6, 7]));
